home *** CD-ROM | disk | FTP | other *** search
- /*
- File: DlpiLib.h
-
- Contains: Defines for the DLPI library
-
- Version: 1.0.0
-
- Copyright: © 1998 by Apple Computer, Inc., all rights reserved.
-
- */
-
- #ifndef _DLPILIB_H_
- #define _DLPILIB_H_
-
- #include "EnetUser.h"
-
- #define kMaxEnetPort 10
- typedef UInt8 EnetAddr[6];
- typedef UInt8 * EnetAddrPtr;
- typedef char EnetPortName[256];
- typedef char * EnetPortNamePtr;
- typedef char EnetPortSlot[256];
- typedef char * EnetPortSlotPtr;
-
- extern FILE *gLPrintfFile;
-
- // LPrintf() does an fprintf() to the global log file.
- // It does nothing if gLPrintfFile is NULL.
- extern int LPrintf(const char *format, ...);
-
- // StringToEnetAddr() converts a printable string to an ethernet address.
- // The format is 01:02:03:04:05, the six bytes in hex.
- // Returns false if there was an error.
- extern Boolean StringToEnetAddr(char *buffer, EnetAddrPtr addr);
-
- // EnetAddrToString() converts an ethernet address to a printable string.
- // The format is 01:02:03:04:05, the six bytes in hex.
- // Returns a pointer to a single static string buffer.
- extern char *EnetAddrToString(EnetAddressPtr addr);
-
- extern char *dl_mac_type_to_string(UInt32 dl_mac_type);
-
- extern char *dl_state_to_string(UInt32 dl_current_state);
-
- extern char *dl_service_mode_to_string(UInt32 dl_service_mode);
-
- extern char *dl_provider_style_to_string(UInt32 dl_provider_style);
-
- extern char *dl_error_to_string(dl_error_ack_t *errorAck);
-
- // dl_set_phys_addr_req() does a DL_SET_PHYS_ADDR_REQ.
- // Returns false if there was an error.
- extern Boolean dl_set_phys_addr_req(int stream, EnetAddrPtr address);
-
- // dl_phys_addr_req() does a DL_PHYS_ADDR_REQ.
- // Returns false if there was an error.
- extern Boolean dl_phys_addr_req(int stream, int addrType, EnetAddressPtr address);
-
- extern Boolean
- dl_get_statistics_req(int stream,
- dl_get_statistics_ack_t *getStatisticsAck,
- dle_interface_status_t **iStatus,
- dle_ethernet_status_t **eStatus);
-
- extern Boolean
- dl_info_req(int stream,
- dl_info_ack_t *infoAck,
- EnetAddrPtr *unicast,
- EnetAddrPtr *broadcast);
-
- extern Boolean dl_detach_req(int stream);
-
- extern Boolean dl_attach_req(int stream, int ppa);
-
- // dl_bind_req() does a DL_BIND_REQ.
- // The stream is bound to the specified protocol SAP.
- // Returns false if there was an error.
- extern Boolean dl_bind_req(int stream, UInt16 sap);
-
- // dl_unitdata_req() does a DL_UNITDATA_REQ.
- // This is the basic transmit operation.
- // Returns false if there was an error.
- extern Boolean
- dl_unitdata_req(int stream, void *buffer, UInt32 size, UInt8 *dest);
-
- // dl_unitdata_ind() handles a DL_UNITDATA_IND.
- // This is the basic receive operation.
- // This function blocks until a packet has been received.
- // Returns false if there was an error.
- extern Boolean
- dl_unitdata_ind(int stream,
- UInt32 maxPacketSize,
- char *packet,
- UInt32 *packetSize,
- EnetAddressPtr address,
- UInt16 proto,
- UInt32 timeoutMilliseconds);
-
- // dl_enabmulti_req() does a DL_ENABMULTI_REQ.
- // The stream will receive packets to the specified multicast address.
- // Returns false if there was an error.
- extern Boolean dl_enabmulti_req(int stream, UInt8 *address);
-
- // dl_disabmulti_req() does a DL_DISABMULTI_REQ.
- // The stream will receive packets to the specified multicast address.
- // Returns false if there was an error.
- extern Boolean dl_disabmulti_req(int stream, UInt8 *address);
-
- extern Boolean dl_promiscon_req(int stream, UInt32 level);
-
- extern Boolean dl_promiscoff_req(int stream, UInt32 level);
-
- extern Boolean ioctl_EnetShim(int stream, ENETShimRequest *enetShimRequest);
-
- extern Boolean ioctl_VirtualController(int stream, VCRequest *vcRequest);
-
- extern Boolean ioctl_FastPath(int stream, dl_unitdata_req_t *unitdata_req);
-
- extern Boolean ioctl_SetFramingType(int stream, UInt32 *framingType);
-
- extern Boolean ioctl_SetRawMode(int stream, void *rawModeReq);
-
- extern Boolean ioctl_EnetLog(int stream, char buffer[kMaxEnetStatus]);
-
- extern Boolean ioctl_EnetStatus(int stream, char buffer[kMaxEnetStatus]);
-
- extern Boolean ioctl_EnetTest(int stream, char buffer[kMaxEnetStatus]);
-
- extern Boolean ioctl_EnetReset(int stream, char buffer[kMaxEnetStatus]);
-
- extern Boolean ioctl_DlpiTest(int stream, UInt32 code);
-
- // GetEnetAddress gets the ethernet address for the specified Enet Port.
- // Returns false if there was an error.
- extern Boolean
- GetEnetAddress(EnetPortNamePtr enetPortName, EnetAddressPtr address);
-
- // GetEnetPortInfo gets the Nth Enet Port name.
- // The index is a positive integer starting at zero.
- // Returns false if there was an error.
- extern Boolean
- GetEnetPortInfo(int n,
- EnetPortNamePtr enetPortName,
- EnetPortSlotPtr enetPortSlot,
- EnetAddrPtr address);
-
- #include <stropts.h>
-
- #include <DriverServices.h>
-
- extern void OTSetServerMode(void);
-
- #endif // _DLPILIB_H_